package com.ymk.cmd;

import com.ymk.base.cmd.ACmd;
import com.ymk.base.cmd.CmdSign;
import com.ymk.base.utlis.ParamsBuilder;
import com.ymk.bo.work.DyAuthorBO;
import com.ymk.core.code.cmd.TicketCmdCode;
import com.ymk.service.IDyAuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class TicketGetCmd extends ACmd {

    @Override
    public CmdSign executeMop(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        ParamsBuilder paramsBuilder = ParamsBuilder.newBuild()
                .addParam("msgType","Ticket");
        DyAuthorBO dyAuthorBO =  dyAuthorService.get(paramsBuilder.build());
        respSign.setSource(super.getSource(dyAuthorBO));
        return respSign;
    }
    /**
     * 命令编号
     *
     * @return
     */
    @Override
    public String getCmdCode() {
        return TicketCmdCode.TICKET_GET;
    }

    @Autowired
    private IDyAuthorService dyAuthorService;
}
